import socket
 
# 创建一个 TCP/IP Socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 
# 创建一个 UDP Socket
udp_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)